package com.jiyun.mapper;

import com.jiyun.pojo.entity.Order;
import com.jiyun.pojo.vo.OrderVo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

public interface FaDanMapper extends Mapper<Order> {
    @Insert("insert into order values(null,#{ordername},#{orderimage},#{statusid},#{userid},#{ptid},#{amout},#{ordertext},#{estimate},#{billtime},#{ordertime},#{deliverytime},#{auditstatus},#{refused})")
    void addOrder(Order order);
    @Select("select o.*,s.`name`,u.nickname from `order` o,`status` s,`user` u where o.statusid=s.statusid and o.userid=u.userid and o.ptid=#{ptid}")
    List<OrderVo> findPaotuiorder(Integer ptid);
    @Select("SELECT * FROM `order` where statusid=1")
    List<Order> selectWherestatusid();
    @Select("select o.*,s.`name`,u.nickname from `order` o,`status` s,`user` u where o.statusid=s.statusid and o.userid=u.userid and o.ptid=#{ptid} and o.statusid=#{seid}")
    List<OrderVo> selectstatus(@Param("ptid") Integer ptid, @Param("seid") Integer seid);
    @Select("select * from `order` where oid=#{oid}")
    Order selectOrderByid(Integer oid);


}
